
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display"%>
<%@ taglib uri="/WEB-INF/config/tld/fmt.tld" prefix="fmt" %>
<%@ taglib uri="http://ssh.org/selects" prefix="ssh"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
String applicationPath = basePath + "/" + "application";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="<%=path%>/css/jinmu_style.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="<%=path%>/js/util.js"></script>
		<script type='text/javascript' src='<%=path%>/frame/orgSelect/js/ajaxInitSelect.js'></script>
<script language="javascript" src="<%=path%>/js/SyncCommon.js"></script>
</head>
<body>
<html:form styleId="yfMaterielDepartForm" action="updateYfMaterielDepart.do?method=updateYfMaterielDepart" onsubmit="return save();">
<html:hidden property="id" value="${yfMaterielDepart.id}"/>
<input type ="hidden" id="type" name="type" value="${yfMaterielDepartForm.type}" />
<table cellspacing="0" cellpadding="0" width="98%" align="center"  border="0" class="margtb5">
		    <tr>
		     <c:if test="${yfMaterielDepartForm.type==0}">
		      <td align="left" class="padl5 lan12"><img src="<%=path%>/images/img-11.gif" width="12" height="12"> 研发辅助 &gt; 物料管理 &gt; 编辑</td>
		      </c:if>
		       <c:if test="${yfMaterielDepartForm.type==1}">
		      <td align="left" class="padl5 lan12"><img src="<%=path%>/images/img-11.gif" width="12" height="12"> 研发辅助 &gt; 设备管理 &gt; 编辑</td>
		      </c:if>
		    </tr>
       </table>
		
	
  <table cellspacing="1" cellpadding="0" width="98%" align="center"  border="0" class="bgcolor2 margb5">
	        	        	 <tr>
		       <td colspan="4" align="left" class="bkuang zi13b bgcolor2 padl5">
		       <c:if test="${yfMaterielDepartForm.type==0}">物料信息</c:if>
	          <c:if test="${yfMaterielDepartForm.type==1}">设备信息</c:if>
		       
		       </td>
		    </tr>
        <tr class="bgcolor">

 
	   <td width="18%" align="right" class="zi13"> 
	            <c:if test="${yfMaterielDepartForm.type==0}">物料名称：<font color="red">*&nbsp;</font></c:if>
	          <c:if test="${yfMaterielDepartForm.type==1}">设备名称：<font color="red">*&nbsp;</font></c:if>
	          </td>
	   <td width="32%"  align="left" class="pad2 zi13">
	                               				  <c:if test="${yfMaterielDepartForm.type==0}"><input type="text"  value="${yfMaterielDepart.madename}" flag="true"  maxlength="60"  valid="required" errMsg="请输入物料名称信息！" id="madename" name="madename"/></c:if>
	          <c:if test="${yfMaterielDepartForm.type==1}"><input type="text"  value="${yfMaterielDepart.madename}" flag="true"  maxlength="60"  valid="required" errMsg="请输入设备名称信息！" id="madename" name="madename"/></c:if>
		         		                       		  
	  </td>
	   <td width="18%" align="right" class="zi13">项目名称：<font color="red">*&nbsp;</font></td>
	   <td width="32%"  align="left" class="pad2 zi13">
	                               				 <input type="text" flag="true"  maxlength="60"  valid="required" errMsg="请输入项目名称！" id="projectName" value="${yfMaterielDepart.projectName}"  readonly="true" name="projectName"/>&nbsp;<input type="button" onclick="chooseProject();" name="choose" value="选择" class="buttonbg" style="cursor:hand">
		         		                       		  
	  </td>

        </tr>
  <tr class="bgcolor">
	   <td width="18%" align="right" class="zi13">项目编号：</td>
	   <td width="32%"  align="left" class="pad2 zi13">
	        <input type="text" id="projectNo" name="projectNo" readonly="true" value="${yfMaterielDepart.projectNo}"/>
		         		                       		  
	  </td>

 
	   <td width="18%" align="right" class="zi13">项目机构：</td>
	   <td width="32%"  align="left" class="pad2 zi13">
	           <ssh:select propertyName="projectOrg" firstShow="Y" dataSource="collection" selectList="${orgSelect}"  readonly="true"  type="1" defaultName="${yfMaterielDepart.projectOrg}"/> 
		         		                       		  
	  </td>
        </tr>
        <tr class="bgcolor">
        <td width="18%" align="right" class="zi13">发起年份：</td>
	   <td width="32%"  align="left" class="pad2 zi13">
	                    <html:select property="initiateYear" style="width:100px" disabled="true"  value="${yfMaterielDepart.initiateYear}">
	                      	 <c:forEach var="i" begin="2010" end="2020" step="1">
	                      	 		<html:option value="${i}">${i}</html:option>
                             </c:forEach>
	                    </html:select>
		         		                       		  
	  </td>
	  
	   <td width="18%" align="right" class="zi13"><bean:message key="com.application.yfmaterieldepart.entity.yfmaterieldepart.createpage.price" bundle="yfmaterieldepart"/>：</td>
	   <td width="32%"  align="left" class="pad2 zi13">
	                               				 <input type="text" flag="true"  maxlength="13" valid="isWanYuan" errMsg="请输入正确的单价！" id="price" name="price" value="${yfMaterielDepart.price}"/>
		         		                       		  
	  </td>

 
	  

        </tr>
 
        <tr class="bgcolor">
         <td width="18%" align="right" class="zi13"><bean:message key="com.application.yfmaterieldepart.entity.yfmaterieldepart.createpage.count" bundle="yfmaterieldepart"/>：</td>
	   <td width="32%"  align="left" class="pad2 zi13">
	                               				 <input type="text" flag="true"  maxlength="13" valid="isInt" errMsg="请输入正确的数量！" id="count" name="count" value="${yfMaterielDepart.count}"/>
		         		                       		  
	  </td>
	   <td width="18%" align="right" class="zi13"><bean:message key="com.application.yfmaterieldepart.entity.yfmaterieldepart.createpage.purchase" bundle="yfmaterieldepart"/>：</td>
	   <td width="32%"  align="left" class="pad2 zi13">
	                               				  <input type="text" readonly="true"   name="purchaseStr" id="purchaseStr" value="${yfMaterielDepart.purchaseStr}" readonly="true"  onclick="popUpCalendarDlg(this)" />
		         		                       		  
	  </td>

 
	

        </tr>
 
        <tr class="bgcolor">
           <td width="18%" align="right" class="zi13"><bean:message key="com.application.yfmaterieldepart.entity.yfmaterieldepart.createpage.vender" bundle="yfmaterieldepart"/>：</td>
	   <td width="32%"  align="left" class="pad2 zi13">
	                               				 <input type="text" id="vender" name="vender" value="${yfMaterielDepart.vender}"/>
		         		                       		  
	  </td>
	   <td width="18%" align="right" class="zi13"><bean:message key="com.application.yfmaterieldepart.entity.yfmaterieldepart.createpage.provider" bundle="yfmaterieldepart"/>：</td>
	   <td width="32%"  align="left" class="pad2 zi13">
	                               				 <input type="text" id="provider" name="provider" value="${yfMaterielDepart.provider}"/>
		         		                       		  
	  </td>

 
	 

        </tr>
 
        <tr class="bgcolor">
          <td width="18%" align="right" class="zi13"><bean:message key="com.application.yfmaterieldepart.entity.yfmaterieldepart.createpage.linkman" bundle="yfmaterieldepart"/>：</td>
	   <td width="32%"  align="left" class="pad2 zi13">
	                               				 <input type="text" id="linkman" name="linkman" value="${yfMaterielDepart.linkman}"/>
		         		                       		  
	  </td>
	   <td width="18%" align="right" class="zi13"><bean:message key="com.application.yfmaterieldepart.entity.yfmaterieldepart.createpage.linkphone" bundle="yfmaterieldepart"/>：</td>
	   <td width="32%"  align="left" class="pad2 zi13">
	                               				 <input type="text" id="linkphone" name="linkphone" value="${yfMaterielDepart.linkphone}"/>
		         		                       		  
	  </td>

        </tr>
 

    </table> 
		<p><p><p>
	
  <table width="98%" align="center" border="0" cellspacing="0" cellpadding="0">
  <tr>
        <td align="center">
		<input class="buttonbg" style="cursor:hand" id="but_save" type="submit" value="<bean:message key='com.manager.common.yfmaterieldepart.save' bundle="yfmaterieldepart"/>" name="but_save" />
		  &nbsp;&nbsp;&nbsp;
	     <input class="buttonbg" style="cursor:hand" id="but_return" type="button" value="<bean:message key='com.manager.common.yfmaterieldepart.return' bundle="yfmaterieldepart"/>" name="but_return" onClick="javascript:history.go(-1);"/>
		 </td>
  </tr>
</table>

</html:form>
</body>
</html>


<script>

function save(){
   if(validateForm(document.forms[0],'Y'))
   {
	return true;
    }else{
	return false;
    }
}
function chooseProject(){   
    var syncHelper = new SyncHelper();
     <c:if test="${loginUser.roleType==3}">
        var url = "popuSelectProjectList.do?method=popuSelectProjectList&type=1&random=" + new Date();
    </c:if>
	<c:if test="${loginUser.roleType!=3}">
        var url = "popuSelectProjectList.do?method=popuSelectProjectList&org=${loginUser.oid}&random=" + new Date();
    </c:if>
	var searchWin = window.showModalDialog(url,window,"help:no;scroll:yes;resizable:no;status:0;dialogWidth:1000px;dialogHeight:600px;center:yes" ); 	
    if(searchWin){
         $("projectName").value = searchWin["projectName"]==undefined?"":searchWin["projectName"];
		 $("projectNo").value = searchWin["projectNo"]==undefined?"":searchWin["projectNo"];
		 syncHelper.selectedByValue(searchWin["projectOrg"],"projectOrg");
		 $("projectid").value = searchWin["projectNo"]==undefined?"":searchWin["projectNo"];
		 syncHelper.selectedByValue(searchWin["initiateYear"],"initiateYear");
		 
		 //$jq("#projectOrg option").not(":selected").attr("disabled", "disabled");

		 
    }
}

</script>





